package com.tedu.boot01.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class BMIController {
    @RequestMapping("/bmi")
    @ResponseBody
    public String bmi(double height,double weight){
        double index = weight/(height*height);
        if (index<18.4){
            return "消瘦";
        }
        if (index<23.9){
            return "正常";
        }
        if(index<27.9){
            return "超重";
        }
        return "肥胖";
    }
}
